package com.antg;

import com.antg.manager.TaskManager;
import com.antg.service.TaskExecutor;
import com.antg.service.TaskGenerator;

import java.io.File;

/**
 * @Description:
 * @Author 子兔Antg
 * @Date 2021/10/31
 **/
public class Run {

    public static void main(String[] args) throws Exception {
        TaskManager taskManager = new TaskManager();
        if(args.length!=2){
            throw new Exception("输入参数格式:输入路径 输出路径");
        }
        //参数格式化
        StringBuilder output = new StringBuilder(args[1]);
        if(!output.toString().endsWith(File.separator)){
            output.append(File.separator);
        }
        //任务生成器
        TaskGenerator taskGenerator = new TaskGenerator(args[0]);
        //任务执行器
        TaskExecutor taskExecutor = new TaskExecutor(output.toString());
        //任务管理器执行
        taskManager.run(taskGenerator,taskExecutor);
    }
}
